<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>设备管理系统用户登录</title>
<link rel="stylesheet" type="text/css" href="js/command.css" />
<script type="text/javascript" src="js/jquery-1.7.min.js"></script>
<script type="text/javascript" src="js/jquery_validation/jquery.validate.js"></script>
<script type="text/javascript" src="js/jquery_validation/jquery.metadata.js"></script>
<script type="text/javascript" src="js/jquery_validation/messages_cn.js"></script>
<style type="text/css">
.page_form_wrap {background: #f7f7f7;padding: 20px 20px 10px;border: 1px solid #babbbc; 
    -webkit-border-bottom-right-radius: 5px;-webkit-border-bottom-left-radius: 5px;
    -moz-border-radius-bottomright: 5px;-moz-border-radius-bottomleft: 5px;
    border-bottom-right-radius: 5px;border-bottom-left-radius: 5px;
    width: 320px;
}
.page_form_wrap p {margin: 0 0 10px;}
.page_form_wrap p label {display: block;margin: 0 0 5px;text-indent: 5px;}
.page_form_wrap p .s {width: 305px;}
.page_form_wrap p.fl label {display: inline;}
.page_form_wrap .button_blue {font-size: 14px;}
</style>
<script type="text/javascript">
var api = frameElement.api, W = api.opener, D = document;
var validTips;
$(function(){	
	$("#login_username").focus();
	/** 用户信息验证 */
	$.metadata.setType("attr", "validate");
	validator = $("#form_login").validate({
		debug: true,
		showErrors: function(errorMap, errorList) {
			if(errorList.length > 0){
				var Msg = "";
				for( i = 0; i < errorList.length; i++ ){
					Msg = Msg + errorList[i].element.name + ":&nbsp;&nbsp;<font color='red'>" + errorList[i].message + "</font><br/>";
				}
				validTips = W.$.dialog.tips(Msg,"hits.png").time(1);
			}
		}, 
		success: function (lable){
			validTips.close();
		}	
	});
	/* 登录验证 */
	$("#btn_login_dms").bind("click", function(){
		if ( !validator.form() ){ 
			return false; 
		}else{
			var username = $.trim( $("#login_username").val() );
			var password = $.trim( $("#login_password").val() );
			if(username == "admin" && password == "admin"){
				W.$.dialog.data("islogin", true);
				W.$.dialog.tips("登录成功", "suc.png", function(){
					W.location.reload();
					//W.$.dialog.list["va_2"].close();
					api.close();
				}).time(1);
			}else{
				W.$.dialog.tips("用户名或密码错误", "fail.png").time(1);
			}
			return true;
		}
	});

});
</script>
</head>
<body>
<div class="page_form_wrap c">
	<form name="form_login" id="form_login">
	<p> 
		<label for="login_username">用户名</label> 
	    <input id="login_username" type="text" class="text s r3px" validate="{required:true,minlength:2,maxlength:10}" name="用户帐号" placeholder="请输入用户名"/> 
	</p>
	<p class="padt10"> 
	    <label for="login_password">密码</label> 
	    <input id="login_password" type="text" class="text s r3px" validate="{required:true,minlength:2,maxlength:10}" name="用户密码" placeholder="请输入密码"/> 
	</p>
	<p class="fr padt10">
		<span>
        	<font color="red">(用户名和密码输入admin登录成功)</font>
	      <input id="btn_login_dms" name="f_btn_login" class="button blue" type="button" value="马上登陆" /> 
		</span>
	</p>
	</form>
</div>
</body>
</html>